import request from '@/utils/request';
/* 
  获取员工列表
*/
export const getEmployeeList = (data: any) => {
    return request({
        url: '/scrm-api/console/riskmonitoring/message/staff-list',
        method: 'POST',
        data
    });
};
/* 
  员工检索列表
*/
export const getChatList = (data: any) => {
    return request({
        url: '/scrm-api/console/riskmonitoring/message/staff-chat-list',
        method: 'POST',
        data
    });
};
// 是否开通消息存档
export const whetherOpen = () => {
    return request({
        url: '/scrm-api/console/riskmonitoring/message/message-config',
        method: 'POST'
    });
};

// 获取客户列表
export const getContactList = (data: any) => {
    return request({
        url: '/scrm-api/console/riskmonitoring/message/contact-list',
        method: 'POST',
        data
    });
};
// 获取客户检索列表
export const getContact = (data: any) => {
    return request({
        url: '/scrm-api/console/riskmonitoring/message/contact-chat-list',
        method: 'POST',
        data
    });
};
// 获取群成员列表
export const getGroupMembers = (data: any) => {
    return request({
        url: '/scrm-api/console/riskmonitoring/message/group-members',
        method: 'POST',
        data
    });
};

// 获取消息类型
export const getMessageType = () => {
    return request({
        url: '/scrm-api/console/riskmonitoring/message/msgtype-list',
        method: 'POST'
    });
};

// 单聊会话详情
export const getChatDetails = (data: any, noNeedLoading = false) => {
    return request({
        url: '/scrm-api/console/riskmonitoring/message/chat-details',
        method: 'POST',
        noNeedLoading,
        data
    });
};
// 群聊会话详情
export const getGroupChatDetails = (data: any, noNeedLoading = false) => {
    return request({
        url: '/scrm-api/console/riskmonitoring/message/group-chat-details',
        method: 'POST',
        noNeedLoading,
        data
    });
};

// 客户聊天详情 - 员工私聊 work_user_id类型
export const getGroupChatDetailsUser = (data: any) => {
    return request({
        url: '/scrm-api/console/customer/chat-detail',
        method: 'POST',
        data
    });
};

/**
 * @description: 获取客户最新聊天
 * @param {any} data
 * @return {*}
 */
export const getCustomerLatestChat = (data: any) => {
    return request({
        url: '/scrm-api/console/riskmonitoring/message/contact-chat-lately',
        method: 'get',
        params: data
    });
};

/**
 * @description: 获取员工最新聊天
 * @param {any} data
 * @return {*}
 */
export const getStaffLatestChat = (data: any) => {
    return request({
        url: '/scrm-api/console/riskmonitoring/message/staff-chat-lately',
        method: 'get',
        params: data
    });
};
